package com.ds.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ds.dao.DataDao;
import com.ds.entity.DSResult;
import com.ds.entity.ElectricityDataEntity;


@RestController
@Api(value = "电量，voc数据接口", tags = { "电量，voc数据接口" })
@RequestMapping("data")
public class DataController {
	
	@Autowired
	DataDao dataDao ;
	
	@ApiOperation(value = "根据code获取用户信息")
	@PostMapping("/electricity")
	public DSResult<List<ElectricityDataEntity>> getElectricity(HttpServletRequest request, String company){
		List<ElectricityDataEntity> data = dataDao.getElectricity(company);
		return new DSResult<List<ElectricityDataEntity>>(data);
		
	}

}
